﻿<?php
session_start();

if (!isset($_SESSION['kid'])) {
    
    include("startseite.php");
    exit();
}
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>tischstarten</title>

    <!-- Bootstrap -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link href="bootstrap/css/style.css" rel="stylesheet">
	<link href="bearbeitung.css" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="js/jquery-1.11.1.min.js"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script src="bootstrap/js/bootstrap.min.js"></script>
	<script>//var $j = jQuery.noConflict();</script>
	<script type="text/javascript">
		$(document).ready(function(){
			var temp="";
			$( "button" ).click(function() {
				temp = temp+$(this).text();
				$("textarea").text(temp).show();
			});
			
			$( "a" ).click(function() {
				if( $(this).text() == "Löschen"){// if Button Löschen is clicked
					temp="";
					$("textarea").text(temp).show();
				}
				
				else if( $(this).text() == "OK"){ // if Button OK is clicked
					if (temp ==""){	// if textfield is empty
						alert ("Bitte Tischnummer eingeben!!!")
						//$("textarea").text(temp).show();
					}
					else{ //if not
						//$.get('gastzahl.php', {t_nr :temp},function(){
							document.location= "gastzahl.php?t_nr="+temp;// go to next site: gastzahl.php
						//});
						
						//$.ajax({
						 // type: "POST",
						  //url: "gastzahl.php",
						  //data: { tnr: temp }
						//})
						
					}
				}
			});
			
			
		});
	
	</script>
  
  </head>
	<body>

	<div class= "container">
		<div class= "jumbotron" style = "background-color: #341256; text-align: center;">
				<p style = "color: white; font-size: 50px;">  Nam Bộ Restaurant</p>
				<p class="bg-info" style = "font-size: 30px;">  Tischnummer eingeben</p>
		</div>
		<div class= "jumbotron" style = "background-color: #341256; text-align: center;">
			
			<div class= "row">
				<div class="col-md-8">
					<div class= "row">
						
						<div class="form-group has-error">
							<textarea  class="form-control" placeholder="Tischnummer" rows="1" style ="font-size: 30px; text-align:center;"></textarea>
						</div>
					</div>
					<br>
					<div class= "row">							
						<div class= "col-md-4">
							<button id = "btn-key" class="btn btn-primary btn-lg btn-block">1</button>
						</div>
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">2</button>
						</div>
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">3</button>
						</div>
					</div>	
					<br>
					<div class= "row">							
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">4</button>
						</div>
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">5</button>
						</div>
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">6</button>
						</div>
					</div>
					<br>
					<div class= "row">							
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">7</button>
						</div>
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">8</button>
						</div>
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">9</button>
						</div>
					</div>	
					<br>
					<div class= "row">
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">0</button>
						</div>
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">.</button>
						</div>
						<div class= "col-md-4">
							<button type="button" class="btn btn-primary btn-lg btn-block">00</button>
						</div>
					</div>
				</div>
				
				<div class="col-md-4">
					<div class= "row">
						<div class="col-md-3">
						</div>
						<div class="col-md-7">
						
							<a  class="btn btn-danger btn-lg btn-block" role="button" style ="font-size: 25px;"><br>Löschen<br><br></a>
							<br>
							<a class="btn btn-success btn-lg btn-block" role="button" style ="font-size: 25px;"><br>OK<br><br></a>
							<br>
							<a href="bearbeitung.php" class="btn btn-warning btn-lg btn-block" role="button" style ="font-size: 25px;"><br>Abmelden<br><br></a>
							
						</div>
					</div>
				</div>
			
			</div>
		</div>
	</div>
	 
	
	</body>
</html>

